<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template_dialog.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<title>#{request.getParameter('lineName')} 故障报告</title>
		<style>
.ui-widget {
font-family: "Microsoft JhengHei"; font-weight: bold; font-size: 1.15em;
}

.ui-commandlink {
font-family: FontAwesome;
}

.ui-panel .ui-panel-content {
border: 0; background: 0; padding: 0 !important;
}

.ui-panel .ui-panel-titlebar-icon {
margin-top: 0;
}

.ui-datatable .ui-datatable-footer {
text-align: right; padding: 4px 10px;
}

.ui-datatable .ui-datatable-header {
text-align: left; padding: 4px 16px;
/* border-top: 0px;
    border-left: 0px; */
}

.ui-datatable .ui-datatable-data {
border-top: 0px; border-left: 0px;
}

.ui-md-6,.ui-md-12,.ui-g-6,.ui-g-12 {
padding: 0px !important;
}

/* tr,tr td:first-child,tr th:first-child{
	border-left-width:0px !important;
} */
.box-tools i {
cursor: pointer; color: #999; margin-right: 5px;
}

.mouseon {
cursor: pointer;
}

.box-tools i:hover {
color: #3FA7DC;
}

.btn {
padding: 1px 6px;
}

td {
padding: 9px;
}

.ui-fileupload-icon-only .ui-button-text {
padding-bottom: .5em;
}
/**
* 分析详情里面的差动电流的title 居中
*/
.title-center .ui-datatable-header {
text-align: center;
}
</style>
		<link href='/resources/plugins/layer/skin/layer.css' rel='stylesheet' />
	</ui:define>
	<ui:define name="content">
		<h:form id="form10">
			<h:inputHidden id="actTimeList" value="#{busFaultDetailsController.actTimeList}" />
		</h:form>
		<div id="reportDiv" style="width: 100%; margin-left: auto; margin-right: auto;">
			<h:form id="actForm">
				<p:growl id="msgs" showDetail="true" />
				<p:panel header="动作分析" style="text-align: center;font-size:18px;">
					<f:facet name="actions">
						<p:commandButton rendered="#{busFaultDetailsController.showBackButton}"
							style="float:left;font-size:16px;" icon="fa fa-chevron-circle-left" onclick="back();"
							value="返回" />
						<p:commandButton
							rendered="#{s:hasPermission(session,'zym_bhrb_gzrb_bj')}"
							style="float:left;font-size:16px;" icon="ui-icon-pencil" value="编辑" update="actForm:msgs"
							actionListener="#{busFaultDetailsController.checkEditPageAct(busFaultDetailsController.record)}" />
						<p:commandButton id="imagePanelButton" style="float:right;font-size:16px;" type="button"
							rendered="#{busFaultDetailsController.pmodel.firstSt != null}" onclick="openImagePanel();"
							value="报告附件" />
						<p:commandButton id="faultDetailButton" style="float:right;font-size:16px;" type="button"
							onclick="openTotalDetail();" rendered="#{busFaultDetailsController.pmodel.firstSt != null}"
							value="故障详情" />
						<p:commandButton style="float:right;font-size:16px;" type="button" onclick="exchangeView();"
							rendered="#{busFaultDetailsController.pmodel.firstSt != null}" value="动作列表" />
					</f:facet>
					<div class="ui-g" id="report" style="display: none">
						<p:outputPanel id="actList1" rendered="#{busFaultDetailsController.firstAction != null}">
							<p:dataTable emptyMessage="无记录" value="#{busFaultDetailsController.firstActList}" var="item">
								<f:facet name="header">
									<h:outputText value="#{busFaultDetailsController.pmodel.firstSt.substationName}" />
								</f:facet>
								<p:column headerText="保护名称">
										#{item.name}
									</p:column>
								<p:column headerText="保护型号">
										#{item.dev_type}
									</p:column>
								<p:column headerText="动作时间">
									<h:outputText rendered="#{item.distance_0_moments_time gt 0}"
										value="#{item.distance_0_moments_time/1000}ms" />
									<h:outputText rendered="#{item.distance_0_moments_time le 0}" value="" />
								</p:column>
								<p:column headerText="动作情况">
									<h:outputText rendered="#{item.distance_0_moments_time gt 0}" value="跳#{item.phase}">
									</h:outputText>
									<h:outputText rendered="#{item.distance_0_moments_time le 0}" style="color:red"
										value="未检测到跳闸信号" />
								</p:column>
							</p:dataTable>
						</p:outputPanel>
					</div>
					<div id="svgBox" class="onshow">
						<span id='span' style='display: none; font-size: 16px'></span>
						<div class="tools" style="height: 40px; line-height: 40px">
							<div class="box-tools pull-right">
								<i class="glyphicon glyphicon-th-large" title="查看全部" id="seeAllInfo"></i> <i
									class="fa fa-refresh" aria-hidden="true" title="还原" id="refresh"></i> <i
									class="glyphicon glyphicon-download-alt" title="保存为图片" id="saveAsImage"> </i>
							</div>
						</div>
						<div id="actSvg" class="with-border">
							<svg id="svg"></svg>
						</div>
						<canvas id="canvas" style='display: none'></canvas>
					</div>
				</p:panel>
				<div id="imagePanelDiv" style="display: none">
					<p:panel id="imagePanel" header="保护动作报告附件" style="text-align: center;">
						<f:facet name="actions">
							<p:commandButton value="下载" ajax="false" style="float:right;font-size:16px;"
								rendered="#{s:hasPermission(session,'zym_bhrb_gzrb_fjxz')}"
								disabled="#{busFaultDetailsController.attachmentList == null || busFaultDetailsController.attachmentList.size() == 0}"
								actionListener="#{busFaultDetailsController.downloadAttachment()}"
								icon="ui-icon-arrowthick-1-s" update="actForm:msgs">
								<p:fileDownload value="#{busFaultDetailsController.file}" />
							</p:commandButton>
						</f:facet>
						<p:dataTable id="fat" var="componts" widgetVar="fat" rowIndexVar="ite"
							value="#{busFaultDetailsController.attachmentList}" rowKey="#{componts.id}"
							emptyMessage="无记录">
							<p:column headerText="序号" width="10">
								<h:outputText value="#{ite+1}" />
							</p:column>
							<p:column headerText="名称" width="90">
								<h:outputText value="#{componts.name}" />
							</p:column>
							<p:column headerText="缩略图" width="18%">
								<p:graphicImage alt="加载失败" rendered="#{busFaultDetailsController.isPicture(componts)}" height="100" value="#{request.contextPath}/getServerImage?fullPath=#{busFaultDetailsController.getVirtualPath(componts.path)}"/>
							</p:column>
							<p:column width="10" style="text-align: center">
					            <p:commandButton icon="ui-icon-search" rendered="#{busFaultDetailsController.isPicture(componts)}" oncomplete="openImagePage('#{busFaultDetailsController.getVirtualPath(componts.path)}');"/>
					        </p:column>
						</p:dataTable>
					</p:panel>
				</div>
			</h:form>
			<div id="faultDetailPanel" style="display: none">
				<h:form id="form1">
					<p:remoteCommand name="refreshController" oncomplete="refreshHtml()"
						actionListener="#{busFaultDetailsController.init}"></p:remoteCommand>
					<p:remoteCommand name="refreshHtml" oncomplete="refreshSvg()"
						update=":form10:actTimeList actForm:actList1 actForm:imagePanel form1 detailForm"></p:remoteCommand>
					<p:growl id="msg" showDetail="true" sticky="true" />
					<p:panelGrid style="width:100% !important;">
						<f:facet name="header">
							<p:row style="height:30px;line-height:30px;">
								<p:column colspan="8">
									<p:remoteCommand name="updateFaultId" update="faultId"></p:remoteCommand>
									<h:inputHidden id="faultId" value="#{busFaultDetailsController.faultId}" />
									<h:outputText value="母线故障分析报告" style="font-size:18px;" />
									<p:commandButton id="btn2" style="float:right" value="录波文件" icon="ui-icon-triangle-1-s"
										iconPos="right"></p:commandButton>
									<p:menu overlay="true" trigger="btn2" my="top" at="bottom"
										model="#{busFaultDetailsController.firstWaveListModel}">
									</p:menu>
									<p:commandButton id="file" actionListener="#{busFaultDetailsController.downLoadFile()}"
										update="msg" style="display:none;" ajax="false">
										<p:fileDownload value="#{busFaultDetailsController.file}" />
									</p:commandButton>
								</p:column>
							</p:row>
						</f:facet>
						<p:row>
							<p:column >厂站名称：</p:column>
							<p:column >
								<h:outputText style="float: left;font-size:15px;color:blue;"
									value="#{busFaultDetailsController.pmodel.firstSt.substationName}"></h:outputText>
							</p:column>
							<p:column >故障设备：
						</p:column>
							<p:column >
								<h:outputText value="#{busFaultDetailsController.record.equipment}" style="color:blue;" />
							</p:column>
							<p:column >故障时间：
						</p:column>
							<p:column >
								<h:outputText style="color:blue;" value="#{busFaultDetailsController.record.faultTime}">
									<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
								</h:outputText>
							</p:column>
							<p:column >故障类型：
						</p:column>
							<p:column>
								<h:outputText style="color:blue;" value="#{busFaultDetailsController.pmodel.faultType}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column rowspan="2">电压等级：
						    </p:column>
							<p:column rowspan="2">
								<h:outputText style="color:blue;" value="#{busFaultDetailsController.pmodel.voltageLevel}" />
							</p:column>
							<p:column rowspan="2">故障原因分类：
						    </p:column>
							<p:column rowspan="2">
								<h:outputText value="#{busFaultDetailsController.pmodel.faultReason}" />
							</p:column>
							<p:column >
								<h:outputText value="故障原因：" />
							</p:column>
							<p:column style="width:300px;" colspan="3">
								<h:outputText escape="false" style="color:blue;"
									value="#{busFaultDetailsController.replaceWithBr(busFaultDetailsController.record.remark)}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="智能分析：" />
							</p:column>
							<p:column style="width:300px;" colspan="3">
								<h:outputText escape="false" style="color:blue;white-space:pre-wrap;display:block;"
									value="#{busFaultDetailsController.replaceWithBr(busFaultDetailsController.record.thunderInfo)}" />
								<h:outputText escape="false" style="color:blue;white-space:pre-wrap;display:block;"
									value="#{busFaultDetailsController.replaceWithBr(busFaultDetailsController.record.iceInfo)}" />
							</p:column>
							<!-- <p:column rowspan="1">预测原因：
						    </p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{busFaultDetailsController.pmodel.faultForecastReason}" />
								<p:commandLink style="float:right;" styleClass="fa fa-question-circle-o"
									title="基于保护大数据的输电线路故障原因自动预测" />
								<p:commandButton style="float:right;" title="重新预测" icon="fa fa-refresh"
									actionListener="#{busFaultDetailsController.forecast}" update="msg" />
							</p:column> -->
						</p:row>
						<p:row>
							<p:column rowspan="2">录波情况：</p:column>
							<p:column rowspan="2">
								<h:outputText style="color:blue;"
									value="#{busFaultDetailsController.pmodel.firstSt.waveRecordCondition}" />
							</p:column>
							<p:column rowspan="2">故障电流：</p:column>
							<p:column>二次值(A)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{busFaultDetailsController.pmodel.firstSt.secondElectricity}" />
							</p:column>
							<p:column rowspan="2">
								<p:outputLabel value="故障持续时间(ms)：" />
							</p:column>
							<p:column rowspan="2" colspan="2" style="width:15%">
								<h:outputText style="color:blue;"
									value="#{busFaultDetailsController.pmodel.firstSt.firstFault /1000}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>一次值(kA)：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{busFaultDetailsController.pmodel.firstSt.firstElectricity}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>快速保护是否动作：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{busFaultDetailsController.pmodel.firstSt.rapidProtection}" />
							</p:column>
							<p:column>快速保护应评价次数：</p:column>
							<p:column>
								<h:outputText style="color:blue;"
									value="#{busFaultDetailsController.pmodel.firstSt.rapidProtectionShould}" />
							</p:column>
							<p:column>实际快速动作次数：</p:column>
							<p:column colspan="5">
								<h:outputText style="color:blue;"
									rendered="#{busFaultDetailsController.pmodel.firstSt.protectRightActionCount != null and busFaultDetailsController.pmodel.firstSt.protectRightActionCount > 0}"
									value="#{busFaultDetailsController.pmodel.firstSt.rapidActionReality}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>初步分析结论： </p:column>
							<p:column colspan="3" style="color:blue;">
								<p:outputLabel>
							保护正确动作
							#{busFaultDetailsController.pmodel.firstSt.protectRightActionCount == null?0:busFaultDetailsController.pmodel.firstSt.protectRightActionCount}
							次，误动	
							#{busFaultDetailsController.pmodel.firstSt.protectUnwantedActionCount == null?0:busFaultDetailsController.pmodel.firstSt.protectUnwantedActionCount}
							次，拒动
							#{busFaultDetailsController.pmodel.firstSt.protectRefuseActionCount == null?0:busFaultDetailsController.pmodel.firstSt.protectRefuseActionCount}
							次。
					</p:outputLabel>
							</p:column>
							<p:column>初步分析结论：</p:column>
							<p:column colspan="3">
								<h:outputText value="#{busFaultDetailsController.pmodel.conclusion}" style="color:blue;" />
								<p:commandLink value="分析详情  >>>"
									style="margin-left:40px;color: #3aa727;text-decoration: underline;"
									onclick="openbusDetail()" />
							</p:column>
						</p:row>
					</p:panelGrid>
					<p:panel style="border:0px;">
						<p:outputPanel>
							<p:dataTable emptyMessage="无动作信息" id="firstDatable" rowIndexVar="ite"
								value="#{busFaultDetailsController.sumFirstActDetailList}" var="item">
								<p:column headerText="序号" style="width:60px;">
									#{ite+1}
								</p:column>
								<p:column headerText="保护名称">
									#{item.protectName}
								</p:column>
								<p:column headerText="保护类型">
									#{item.protectType}
								</p:column>
								<p:column headerText="保护型号">
									#{item.protectModel}
								</p:column>
								<p:column headerText="动作元件">
									#{item.actionComponent}
								</p:column>
								<p:column headerText="功能分类">
									#{item.funClassification}
								</p:column>
								<p:column headerText="动作时间（ms）">
									#{item.actionTime}
								</p:column>
								<p:column headerText="动作情况">
									#{item.actionCondition}
								</p:column>
								<p:column headerText="备注">
									#{item.remark}
								</p:column>
								<f:facet name="footer">
									<div style="text-align: right">
										<p:commandLink value="设置" title="设置动作元件"
											onclick="MyModal.showModal('/ui/config/dataConfig_dialog.xhtml',700,500,'保护动作设置')"
											style="margin-right:20px;" />
										<p:commandLink value="刷新" title="刷新动作元件" oncomplete="refreshSvg()"
											update="firstDatable :form10:actTimeList"
											actionListener="#{busFaultDetailsController.reloadActionData()}"
											style="margin-right:20px;" />
									</div>
								</f:facet>
							</p:dataTable>
						</p:outputPanel>
					</p:panel>
				</h:form>
			</div>
		</div>
		<h:form id="detailForm">
			<div id="busDetailDiv"
				style="width: 100%; text-align: center; margin-left: auto; margin-right: auto; margin-top: 10px;
display: none; padding: 0px 10px;">
				<!-- 变电站名 -->
				<p:commandButton style="float:left;margin-top:5px" icon="fa fa-chevron-circle-left"
					onclick="backToBusReport();" value="返回" />
				<div class="row">
					<!-- 开始站 -->
					<p:panel header="#{busFaultDetailsController.pmodel.firstSt.substationName}   评价详情" />
				</div>
				<!-- 保护动作信息 -->
				<div class="row">
					<!-- 开始站 -->
					<p:dataTable value="#{busFaultDetailsController.firstActList}" var="item"
						emptyMessage="无保护动作情况">
						<p:column headerText="保护名称">
							<h:outputText value="#{item.name}">
							</h:outputText>
						</p:column>
						<p:column headerText="保护型号">
							<h:outputText value="#{item.dev_type}">
							</h:outputText>
						</p:column>
						<p:column headerText="动作时间">
							<h:outputText rendered="#{item.distance_0_moments_time gt 0}"
								value="#{item.distance_0_moments_time/1000}ms">
							</h:outputText>
							<h:outputText rendered="#{item.distance_0_moments_time le 0}" value="" />
						</p:column>
						<p:column headerText="动作情况">
							<h:outputText rendered="#{item.distance_0_moments_time gt 0}" value="跳#{item.phase}">
							</h:outputText>
							<h:outputText rendered="#{item.distance_0_moments_time le 0}" style="color:red"
								value="未检测到跳闸信号" />
						</p:column>
					</p:dataTable>
				</div>
				<!-- 故障电压 -->
				<div class="row">
					<!-- 开始站 -->
					<p:dataTable value="#{busFaultDetailsController.voltageList}" var="item" emptyMessage="无记录">
						<f:facet name="header">
							<h:outputText value="故障电压" />
						</f:facet>
						<p:columnGroup type="header">
							<p:row>
								<p:column rowspan="2" headerText="间隔" />
								<p:column colspan="9" headerText="故障前" />
								<p:column colspan="9" headerText="故障后" />
							</p:row>
							<p:row>
								<p:column colspan="3" headerText="第3周波" />
								<p:column colspan="3" headerText="第2周波" />
								<p:column colspan="3" headerText="第1周波" />
								<p:column colspan="3" headerText="第1周波" />
								<p:column colspan="3" headerText="第2周波" />
								<p:column colspan="3" headerText="第3周波" />
							</p:row>
						</p:columnGroup>
						<p:column>
							<h:outputText value="#{'0'.equals(item.phase)?'3Uο':item.phase}" />
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:green" value="#{item.preValue60}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:green" value="#{item.preValue40}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:green" value="#{item.preValue20}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:red" value="#{item.postValue20}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:red" value="#{item.postValue40}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:red" value="#{item.postValue60}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
					</p:dataTable>
				</div>
				<!-- 故障电流 -->
				<div class="row">
					<!-- 开始站 -->
					<p:dataTable value="#{busFaultDetailsController.currentList}" var="item" emptyMessage="无记录">
						<f:facet name="header">
							<h:outputText value="故障电流" />
						</f:facet>
						<p:columnGroup type="header">
							<p:row>
								<p:column rowspan="2" headerText="间隔" />
								<p:column colspan="9" headerText="故障前" />
								<p:column colspan="9" headerText="故障后" />
							</p:row>
							<p:row>
								<p:column colspan="3" headerText="第3周波" />
								<p:column colspan="3" headerText="第2周波" />
								<p:column colspan="3" headerText="第1周波" />
								<p:column colspan="3" headerText="第1周波" />
								<p:column colspan="3" headerText="第2周波" />
								<p:column colspan="3" headerText="第3周波" />
							</p:row>
						</p:columnGroup>
						<p:column>
							<h:outputText value="#{'0'.equals(item.phase)?'3Iο':item.phase}" />
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:green" value="#{item.preValue60}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:green" value="#{item.preValue40}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:green" value="#{item.preValue20}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:red" value="#{item.postValue20}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:red" value="#{item.postValue40}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:red" value="#{item.postValue60}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
					</p:dataTable>
				</div>
				<!-- 差动电流 -->
				<div class="row" style="margin-bottom: 30px;">
					<p:dataTable value="#{busFaultDetailsController.diffCurrentDetailList}" var="item"
						emptyMessage="无记录">
						<f:facet name="header">
							<h:outputText value="差动电流" />
						</f:facet>
						<p:columnGroup type="header">
							<p:row>
								<p:column rowspan="2" headerText="间隔" />
								<p:column colspan="9" headerText="故障前" />
								<p:column colspan="9" headerText="故障后" />
							</p:row>
							<p:row>
								<p:column colspan="3" headerText="第3周波" />
								<p:column colspan="3" headerText="第2周波" />
								<p:column colspan="3" headerText="第1周波" />
								<p:column colspan="3" headerText="第1周波" />
								<p:column colspan="3" headerText="第2周波" />
								<p:column colspan="3" headerText="第3周波" />
							</p:row>
						</p:columnGroup>
						<p:column>
							<h:outputText value="#{'0'.equals(item.phase)?'3Iο':item.phase}" />
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:green" value="#{item.preValue60}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:green" value="#{item.preValue40}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:green" value="#{item.preValue20}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:red" value="#{item.postValue20}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:red" value="#{item.postValue40}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column colspan="3">
							<h:outputText style="color:red" value="#{item.postValue60}">
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
					</p:dataTable>
				</div>
			</div>
		</h:form>
	</ui:define>
	<ui:define name="contentend">
		<script src="/resources/plugins/snapsvg/snap.svg.js"></script>
		<script type="text/javascript" src="/ui/map/protectActSvg/svgFigure.js" />
		<script type="text/javascript" src="/ui/map/protectActSvg/canvg.js" />
		<script type="text/javascript" src="/ui/map/protectActSvg/actSvgData.js" />
		<script type="text/javascript" src="/ui/map/protectActSvg/drawActSvg.js" />
		<script type="text/javascript" src="/ui/map/protectActSvg/protectActSvg.js" />
		<script type="text/javascript" src="/resources/js/mymodal.js" />
		<script type="text/javascript" src="/resources/plugins/layer/layer.js" />
		<script>
			var lineId = "#{busFaultDetailsController.pmodel.faultLineId}";
			var fault_time = $("#faultTime").val();
			//切换视图
			function exchangeView() {
				$("#report").toggle();
				$("#svgBox").toggle();
				if (iframe.length == 1) {
					parent.reinitIframe();
				}
				resizeHtml();
			}
			function openWaveDlg(fileId, stationId, stationName) {
				window.location.href = "/ui/waveh5/index.html?fileId=" + fileId
						+ "&amp;stationId=" + stationId + "&amp;lineId="
						+ lineId + "&amp;stationName="
						+ encodeURIComponent(stationName)+"&amp;showBackBtn=true";
			}
			function openHarDlg(fileId) {
				window.location.href = "/ui/wave/index.xhtml?fileId=" + fileId
				+ "&amp;lineId=" + lineId + "&amp;showBackBtn=true";
			}
			function backToReport() {
				$("#busDetailDiv").hide();
				$("#reportDiv").show();
			}
			//故障详情
			function openTotalDetail() {
				var status = $("#faultDetailPanel").css("display");
				var btn = document.getElementById('actForm:faultDetailButton');
				if("none" == status ){
					$("#faultDetailPanel").show();
					$("html, body").animate({
					      scrollTop: $("#faultDetailPanel").offset().top }, {duration: 500,easing: "swing"});
				} else if("block" == status ){
					$("#faultDetailPanel").hide();
				}
			}
			//报告附件
			function openImagePanel() {
				var status = $("#imagePanelDiv").css("display");
				var btn = document.getElementById('actForm:imagePanelButton');
				if("none" == status ){
					$("#imagePanelDiv").show();
					$("html, body").animate({
					      scrollTop: $("#imagePanelDiv").offset().top }, {duration: 500,easing: "swing"});
				} else if("block" == status ){
					$("#imagePanelDiv").hide();
				} 
			}
			function gotoFaultReportEdit() {
				updateFaultId();
				var fra = document.createElement("iframe");
				fra.style.background = 'transparent';
				fra.style.border = 0;
				fra.width = "100%";
				fra.id = "faultReportEditIframe";
				fra.height = document.documentElement.clientHeight-10 + "px";
				var faultId = document.getElementById('form1:faultId').value;
				var s = "/ui/dataview/devicefault/busFaultReport.xhtml?faultId=" + faultId + "&amp;showBackButton=true";
				fra.src = s;
				document.body.appendChild(fra);
				$('#reportDiv').hide();
				$(window).scrollTop(0);
			};
			function backFromFaultReportEdit(){
				document.body.removeChild(document.getElementById('faultReportEditIframe'));
				$('#reportDiv').show();
				refreshController();
			}
			//单个站的评价详情
			function openSingleDetail(stationId) {
				window.location.href = "singleProtectActDetail.xhtml?lineId="
						+ lineId + "&amp;faultTime=" + fault_time
						+ "&amp;stationId=" + stationId;
			}

			function reinitDlgPosition(){
				//重新渲染dlg位置
				var dlg=document.getElementById("j_idt11");
				$(dlg).css("top","50px");
			}
			function back(){
				if(parent.parent &amp;&amp; parent.parent.backFromFaultReport){
					parent.parent.backFromFaultReport();
				}else{
					window.history.back();
				}
			}
			function openbusDetail() {
				$("#busDetailDiv").show();
				$("#reportDiv").hide();
			}
			function backToBusReport() {
				$("#busDetailDiv").hide();
				$("#reportDiv").show();
			}
			function openImagePage(path){
				var link = document.createElement('a');
				link.target = "_blank";
				link.href = '/ui/common/imagePage.xhtml?fullPath='+path;
			    document.body.appendChild(link);
				link.click();
				document.body.removeChild(link);
			}
		</script>
	</ui:define>
</ui:composition>
